package com.erli.exchange.core.beans.api;

public class ResultHandler {
	
	private ResultHandler() {
		
	}
	
    public static ResultResponse success(Object obj) {
        return new ResultResponse(ResultEnum.SUCCESS.getCode(), ResultEnum.SUCCESS.getMsg(), obj);
    }

    public static ResultResponse failure(String errorMsg) {
        return new ResultResponse(ResultEnum.FAILURE.getCode(), errorMsg, null);
    }
    
    public static ResultResponse failure(int code, String msg) {
        return new ResultResponse(code, msg, null);
    }
    
    public static ResultResponse failure(ResultEnum errorResultEnum) {
        return new ResultResponse(errorResultEnum.getCode(), errorResultEnum.getMsg(), null);
    }

}
